//
//  GLESPointSprite.h
//  PointSprite
//
//  Created by 畑圭輔 on 10/03/27.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Texture2D.h"

typedef struct 
{
	float x;
	float y;
	
}Vector2F; // 8byte

typedef struct
{
	float red;
	float green;
	float blue;
	float alpha;
	
}Color4F; // 16byte

typedef struct
{
	Vector2F	pos;		// 8 bytes
	Color4F		colors;		// 16 bytes
	float		size;		// 4 bytes
	
}GLESPointSprite; // 28byte

typedef struct
{
	CGPoint	pos;
	Color4F	color;
	float	size;
	float	angle;
	float	life;
	
}Particle;

@interface GLESPointSpriteBase : NSObject {
	
	NSInteger			 _particleMax;
	Particle			*_particles;	// particle
	GLESPointSprite		*_vertices;		// PointSprite Vertex
	GLuint				 _verticesID;	// vertexID
	GLint				_activeParticleIndex;	
	Texture2D			*_texture;
}

- (id) initWithParticlesMaxNum : (NSInteger)max;
- (void) updateParticle : (Particle *)particle;
- (void) presentParticles;
- (void) draw;

@end

